package com.itheima.web.client;

import com.itheima.model.domain.Article;
import com.itheima.model.domain.ArticleDTO;
import com.itheima.service.IArticleService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("/info")
public class ApiController {
    @Autowired
    private IArticleService articleServiceImpl;

    @GetMapping("/article")
    public List<ArticleDTO>  getAllArticles(){
        List<ArticleDTO> list=articleServiceImpl.getAllArticles();
        return list;
    }

}
